/**
 * Created by Noir on 1/6/14.
 */

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var chartDetailSchema = new Schema({
    content : {
        type: Schema.Types.Mixed,
        required: true
    },
    type:{
        type: String,
        lowercase: true,
        enum: ['text','image','audio','video','link'],
        required: true
    },
    position: Number,
    createDate:{
        type: Date,
        default: Date.now
    },
    agreeNumber:{
        type: Number,
        default: 0
    },
    disagreeNumber:{
        type: Number,
        default: 0
    },
    adder: {
        type: Schema.Types.ObjectId,
        ref:'User'
    },
    description: String
});

module.exports = mongoose.model('ChartDetail', chartDetailSchema);